/**
 * 
 */
package com.dovgopoly.carlogbook.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

/**
 * @author e.dovgopoliy
 *
 */
@MappedSuperclass
public class AbstractBaseEntity implements Serializable {

	private static final long serialVersionUID = 338988134860637007L;

	
	/**
	 * Primary key field.
	 */
	private Long id;

	/**
	 * Version value, used for persistence only.
	 */
	private Long version;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", nullable = false, length = 20)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public Long getVersion() {
		return version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}
	
	
}
